package com.example.demo.day0219;

import java.util.Random;

public class ForEachTest {
    public static void main(String[] args){
    Random rand=new Random(47);
    float f[]=new float[10];
    for (int i=0;i<10;i++)
    f[i]=rand.nextFloat();
    for (float x:f)//定义了一个float类型的变量x，把每个f的元素赋值给x
        System.out.println(x);
}

}
